﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;

public class RightClickMenu : MonoBehaviour
{
    public GameObject Menu;
    private bool isMenuVisible = false;

    private void Start()
    {
        // 隐藏菜单图像
        Menu.SetActive(false);
    }

    private void OnMouseOver()
    {
        if (Input.GetMouseButtonDown(1))
        {
            if (!isMenuVisible)
            {
                Menu.SetActive(true);
                isMenuVisible = true;
            }
            else
            {
                Menu.SetActive(false);
                isMenuVisible = false;
            }
        }
    }

}
